<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
	<base href="<%=basePath %>" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>工作台</title>
	
	<jsp:include page="./common/include.jsp"></jsp:include>
    <link href="css/index.css" rel="stylesheet">
</head>
<body>
	<%@include file="./common/header.jsp" %>
	<div id="main">
		<form id="deploy-form" action="deploy.do" method="post" enctype="multipart/form-data">
		<div id="main-panel">
			<div class="host-main">
				<div class="panel">
	                 <div class="heading">
	                     <span class="title">打包服务器</span>
	                 </div>
	                 <div class="content">
						<div class="input-control text">
							<input name="hostVO.hostIp" type="text" placeholder="server ip">
						</div>
						<div class="input-control text">
							<input name="hostVO.port" type="text" placeholder="server port">
						</div>
						<div class="input-control text">
							<input name="hostVO.userName" type="text" placeholder="ssh username">
						</div>
						<div class="input-control password">
							<input name="hostVO.passWord" type="password" placeholder="ssh password">
						</div>
						<div class="input-control text">
							<input name="hostVO.svnVO.svnDir" type="text" placeholder="svn url">
						</div>
						<div class="input-control text">
							<input name="hostVO.svnVO.svnUserName" type="text" placeholder="svn username">
						</div>
						<div class="input-control password">
							<input name="hostVO.svnVO.svnPassword" type="password" placeholder="svn password">
						</div>
						<div class="input-control password">
							<input name="hostVO.warName" type="text" placeholder="war name">
						</div>
					</div>
	             </div>
             </div>
             <div id="dest-server" class="host-other">
             	<div style="display: none;">
	             	<div class="panel dest">
		                 <div class="heading">
		                     <span class="title">部署服务器</span>
		                     <span style="display: block;float:right;margin: -20px 3px 0 0;" class="mif-cross" onclick="deleteCfgFile(this);"></span>
		                 </div>
		                 <div class="content">
		                    <div class="input-control text host-war">
								<input type="text" placeholder="server ip">
							</div>
		                    <div class="input-control text host-war">
								<input type="text" placeholder="server port">
							</div>
							<br/>
		                    <div class="input-control text host-war">
								<input type="text" placeholder="ssh username">
							</div>
		                    <div class="input-control password host-war">
								<input type="password" placeholder="ssh password">
							</div>
		                    <div class="input-control text host-war">
								<input type="text" placeholder="webapp path">
							</div>
		                    <div class="input-control text host-war">
								<input type="text" placeholder="startup sh path">
							</div>
		                    <div class="input-control text host-war">
								<input type="text" placeholder="shutdown sh path">
							</div>
							<div class="input-text-file input-control text host-war">
								<input class="warpath" type="text" placeholder="config file war path">
							    <input class="file" type="file">
								<span style="display: block;float:right;margin: -20px 3px 0 0;" class="mif-cross fg-red" onclick="deleteDestServer(this);"></span>
							</div>
							<div style="display: none;">
			                    <div class="input-text-file input-control text host-war">
									<input class="warpath" type="text" placeholder="config file war path">
								    <input class="file" type="file">
									<span style="display: block;float:right;margin: -20px 3px 0 0;" class="mif-cross fg-red" onclick="deleteDestServer(this);"></span>
								</div>
							</div>
							<div style="text-align: right;">
								<button class="add-cfg button mini-button primary" type="button" onclick="addCfgFile(this);">+</button>
		                 	</div>
		                 </div>
		             </div>
		          </div>
				<div class="panel dest">
	                 <div class="heading">
	                     <span class="title">部署服务器</span>
	                     <span style="display: block;float:right;margin: -20px 3px 0 0;" class="mif-cross" onclick="deleteCfgFile(this);"></span>
	                 </div>
	                 <div class="content">
	                    <div class="input-control text host-war">
							<input type="text" placeholder="server ip">
						</div>
	                    <div class="input-control text host-war">
							<input type="text" placeholder="server port">
						</div>
						<br/>
	                    <div class="input-control text host-war">
							<input type="text" placeholder="ssh username">
						</div>
	                    <div class="input-control password host-war">
							<input type="password" placeholder="ssh password">
						</div>
	                    <div class="input-control text host-war">
							<input type="text" placeholder="webapp path">
						</div>
						<div class="input-control text host-war">
							<input type="text" placeholder="startup sh path">
						</div>
						<div class="input-control text host-war">
							<input type="text" placeholder="shutdown sh path">
						</div>
						<div class="input-text-file input-control text host-war">
							<input class="warpath" type="text" placeholder="config file war path">
					    	<input class="file" type="file">
							<span style="display: block;float:right;margin: -20px 3px 0 0;" class="mif-cross fg-red" onclick="deleteDestServer(this);"></span>
						</div>
						<div style="display: none;">
		                    <div class="input-text-file input-control text host-war">
								<input class="warpath" type="text" placeholder="config file war path">
							    <input class="file" type="file">
								<span style="display: block;float:right;margin: -20px 3px 0 0;" class="mif-cross fg-red" onclick="deleteDestServer(this);"></span>
							</div>
						</div>
						<div style="text-align: right;">
							<button class="add-cfg button mini-button primary" type="button" onclick="addCfgFile(this);">+</button>
	                 	</div>
	                 </div>
	             </div>
	         </div>   
	         
             <div class="host-other-button">
            	<button class="button primary cycle-button" type="button" onclick="addDestServer(this);"><span class="mif-plus"></span></button>
             </div>
		</div>
		<div id="main-button">
			<button id="start-deploy" class="button warning loading-pulse" type="button" disabled="disabled">开始部署</button>
			<button id="start-deploy-cfg" class="button primary loading-pulse" type="button">从配置文件部署</button>
		</div>
		</form>
		<div id="main-hint" style="margin-bottom: 60px;">
			<p>1. 填写打包服务器信息(包括SVN信息)</p>
			<p>2. 填写需要部署服务器信息(包括web部署路径、需要替换的配置文件)</p>
			<p>3. 点击“开始部署”</p>
		</div>
		
	</div>
	<%@include file="./common/footer.jsp" %>
	<script src="js/index.js"></script>
</body>
</html>